<div class="breadcrumbs">
    <div class="container-fluid">
        <ul class="bread pull-left">
            <li><a href="{$config->site_url('monitoring/aktifitas')}">Monitoring</a></li>
            <li><a href="{$config->site_url('monitoring/aktifitas')}">Aktifitas Dosen</a></li>
            <li class="active"><a href="#">{$rs_dosen.nama_lengkap}</a></li>
        </ul>
    </div>
</div>
<div class="row-fluid">
    <div class="span12">
        <div class="box">
            <div class="box-content">
                <form action="{$config->site_url('monitoring/aktifitas/search_detail')}" class="form-horizontal" method="post">
                    <input type="hidden" name="tahun" value="{$tahun}" />
                    <input type="hidden" name="semester" value="{$semester}" />
                    <input type="hidden" name="dosen_kd" value="{$dosen_kd}" />
                    <table width="100%">
                        <tr>
                            <td width="10%">Mata Kuliah</td>
                            <td width="40%">
                                <select name="makul_kd" class="span10">
                                    <option value=""></option>
                                    {foreach from=$rs_makul item=m}
                                    <option value="{$m.makul_kd}" {if $search.makul_kd|default:'' == $m.makul_kd}selected='selected'{/if}>{$m.makul_nm}</option>
                                    {/foreach}
                                </select>
                            </td> 
                            <td width="50%">
                                <input class="btn btn-primary" type="submit" value="Cari" name="save" />
                                <input class="btn btn-danger" type="submit" value="Reset" name="save" />
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        <!-- notification template -->
        {include file="base/templates/notification.html"}
        <!-- end of notification template-->
        <div class="box">
            <div class="box-head">
                <h3>Detail Aktifitas Dosen</h3>
            </div>
            <div class="box-content box-nomargin">
                <table class='table table-striped dataTable table-bordered'>
                    <thead>
                        <tr>
                            <th width="5%"><b>No.</b></th>
                            <th width="30%"><b>Mata Kuliah</b></th>
                            <th width="5%"><b>SKS</b></th>
                            <th width="15%"><b>Kelas</b></th>
                            <th width="15%"><b>Rencana Pertemuan</b></th>
                            <th width="15%"><b>Realisasi Pertemuan</b></th>
                            <th width="15%"><b>Persentase Pertemuan</b></th>
                        </tr>
                    </thead>
                    <tbody>
                        {$no=1}
                        {$total_rencana = 0}
                        {$total_realisasi = 0}
                        {foreach from=$rs_id item=result}
                        <tr>
                            <td style="text-align: center;">{$no++}.</td>
                            <td>{$result.makul_nm|default:''}</td>
                            <td style="text-align: center;">{$result.makul_sks|default:''}</td>
                            <td>{$result.kelas_nm|default:''}</td>
                            {$rencana = $aktif->get_total_rencana_pertemuan(array($tahun, $semester, $dosen_kd, $result.makul_kd))}
                            {$total_rencana = $total_rencana + $rencana}
                            <td style="text-align: center;">{$rencana}</td>
                            {$realisasi = $aktif->get_total_realisasi_pertemuan(array($tahun, $semester, $dosen_kd, $result.kelas_kd))}
                            {$total_realisasi = $total_realisasi + $realisasi}
                            <td style="text-align: center;">{$realisasi|round}</td>
                            {if $rencana != 0}{$persen = ($realisasi/$rencana)*100}{else}{$persen = 0}{/if}
                            <td style="text-align: center;">{$persen|round} %</td>
                        </tr>
                        {foreachelse}
                        <tr>
                            <td colspan="7">Data tidak ditemukan !</td>
                        </tr>
                        {/foreach}
                        <tr>
                            <td colspan="4" style="text-align: right;"><b>TOTAL</b></td>
                            <td style="text-align: center;"><b>{$total_rencana}</b></td>
                            <td style="text-align: center;"><b>{$total_realisasi}</b></td>
                            {if $total_rencana != 0}{$total_persen = ($total_realisasi/$total_rencana)*100}{else}{$total_persen = 0}{/if}
                            <td style="text-align: center;"><b>{$total_persen|round} %</b></td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>